Skip to content

Generate local resources in a .bazelrc file#90

Draft
Ahajha wants to merge 1 commit into
mainfrom
trotta/generate-local-resources-in-a-.bazelrc-file
Draft

Generate local resources in a .bazelrc file#90
Ahajha wants to merge 1 commit into
mainfrom
trotta/generate-local-resources-in-a-.bazelrc-file

Conversation

@Ahajha
Copy link
Copy Markdown
Member

@Ahajha Ahajha commented May 28, 2026

A recent Bazel change now errors if a local resource is requested but it will never be available (bazelbuild/bazel@d9861632b5)

This does another round of querying nvidia/rocm/amd-smi for GPU count and GPU memory so that we can fill these in. We use these internally to schedule tests on GPUs with memory counts, this makes a local GPU look a bit more like a remote one. This should allow smarter scheduling of local tests so the GPU isn't overloaded.

Heavily Claude-generated.

A recent Bazel change now errors if a local resource is requested but it will never be available (bazelbuild/bazel@d9861632b5)

This does another round of querying nvidia/rocm/amd-smi for GPU count and GPU memory so that we can fill these in. We use these internally to schedule tests on GPUs with memory counts, this makes a local GPU look a bit more like a remote one. This should allow smarter scheduling of local tests so the GPU isn't overloaded.

Heavily Claude-generated.
Comment on lines +255 to +266
if nvidia_smi:
count, mb = _detect_nvidia_memory(rctx, nvidia_smi)
total_gpu_count += count
total_gpu_memory_mb += mb
if amd_smi:
count, mb = _detect_amd_smi_memory(rctx, amd_smi)
total_gpu_count += count
total_gpu_memory_mb += mb
elif rocm_smi:
count, mb = _detect_rocm_smi_memory(rctx, rocm_smi)
total_gpu_count += count
total_gpu_memory_mb += mb
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also include Apple GPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants